package com.sc.nft.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.BusinessCardOrder;
import com.sc.nft.entity.UserInfo;
import com.sc.nft.entity.vo.BusinessCardOrderAdminVO;
import com.sc.nft.entity.vo.CreateOrderVO;
import com.sc.nft.entity.vo.UserBusinessCardOrderPageVO;
import com.sc.nft.exception.GlobalException;

import java.util.List;

/**
 * @author zhangchao
 * @description 针对表【sc_business_card_order(订单sql表)】的数据库操作Service
 * @createDate 2024-07-08 18:30:28
 */
public interface BusinessCardOrderService {

    /**
     * 创建名片购买订单
     *
     * @return
     */
    CreateOrderVO createOrder(UserInfo user);

    /**
     * 支付成功订单回调
     * @param order
     */
    void paySuccess(BusinessCardOrder order);

    /**
     * web订单列表
     * @param mp
     * @return
     */
    Page<UserBusinessCardOrderPageVO> userBusinessCardOrderPage(Page mp, Long userId);

    Page<BusinessCardOrderAdminVO> adminBusinessCardOrderPage(Page page,
                                                              String orderNo,
                                                              String userTel,
                                                              String orderStartTime,
                                                              String orderEndTime,
                                                              String payStartTime,
                                                              String payEndTime);

    /**
     * 获取订单状态
     * @param id
     * @return
     */
    Boolean orderSuccessStatus(Long id);

    /**
     * 关闭订单
     * @param id
     */
    void closeOrder(Long id);

    /**
     * 2次付款订单数据
     * @param id
     * @return
     */
    CreateOrderVO secondaryPayment(Long id);

    /**
     * 获取关闭订单
     * @return
     */
    List<BusinessCardOrder> getCloseOrder();

    /**
     * 自动关闭超时订单
     * @param order
     */
    void autoCloseOrder(BusinessCardOrder order)throws GlobalException;

    List<BusinessCardOrder> getWaitSettleOrder();

    void waitSettleOrder(BusinessCardOrder order)throws GlobalException;
}
